package com.cskaoyan.shopping.controller;

import com.cskaoyan.mall.commons.result.ResponseData;
import com.cskaoyan.mall.commons.result.ResponseUtil;
import com.cskaoyan.shopping.dto.PanelDto;
import com.cskaoyan.shopping.service.IHomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Set;

/*
 * @Auther:王贲
 * @Date:2022/9/21
 * @Description:
 * @VERSON:1.8
 */
@RestController
@RequestMapping("/shopping")
public class MarketController {

    @Autowired
    IHomeService iHomeService;

    @GetMapping("/homepage")
    public ResponseData index() {
        Set<PanelDto> homepage = iHomeService.homepage();
        return new ResponseUtil().setData(homepage);
    }
}
